import type { CascaderProps } from 'antd';

export interface CityPickerValue {
  value: string;
  label: string;
  parentAdcode: string;
  /**
   * @example 北京-北京城区-xxx
   */
  mergerShortName: string;
}

export interface CityPickerData extends CityPickerValue {
  children?: CityPickerData[];
}

export type CityPickerProps = Omit<CascaderProps<CityPickerValue>, 'value' | 'onChange' | 'placeholder'> & {
  value?: CityPickerValue & { path?: string[] };
  onChange?: (item: CityPickerProps['value']) => void;
  /**
   * @todo 当前还不支持仅选择到市或者既可以选择市也可以选择区
   */
  level?: 'city' | 'province' | 'area' | 'city-area';
  placeholder?: string;
};
